/*****************************************************************************
 * stack.h: Silly  stack interface
 *****************************************************************************
 * Copyright (C) 2012
 *
 * Authors: Dan Larkin <danielhlarkin@gmail.com>
 *          Yonatan Naamad <cached@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *****************************************************************************/

#ifndef CPM_STACK
#define CPM_STACK

#include <stdint.h>
#include <stdlib.h>

typedef struct cpm_stack_node
{
    struct cpm_stack_node *next;
    void *element;
} cpm_stack_node;

typedef struct cpm_stack
{
    cpm_stack_node *head;
} cpm_stack;

void cpm_stack_push( cpm_stack *stack, void *element );
void* cpm_stack_pop( cpm_stack *stack );
int cpm_stack_empty( cpm_stack *stack );

#endif
